(function() {

    /**
     * Result of validation
     */
    var validationResultObject = {

        UNKNOWN : 1,

        SUCCESS : 2,

        FAILED : 4,

        IN_PROGRESS : 8,

        simplifyResult : function(value) {
            if (value === this.UNKNOWN) return this.UNKNOWN;
            else if (value === this.SUCCESS) return this.SUCCESS;
            else if ((value & this.IN_PROGRESS) === this.IN_PROGRESS) return this.IN_PROGRESS;
            else return this.FAILED;
        }

    };

    juliet.registerModule('juliet.validation', 'validationResult', validationResultObject);

})();
